package chapter3.lessons.filePart;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

/**
 * @Project ：learn_java
 * @File ：FileInputStreamDemo01.java
 * @IDE ：IntelliJ IDEA
 * @Author ：自由如风间
 * @Date ：2025/2/28 19:50
 * @Description ：读取流学习
 */

public class FileInputStreamDemo01 {
    public static void main(String[] args) throws Exception {
        try (FileInputStream fis = new FileInputStream("IOTestOutputFiles/fileExample.txt")) {
            while (true) {
                int read = fis.read();
                if (read == -1) {
                    break;
                }
                System.out.print((char) read);
            }
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }

    }
}
